function requireAll() {
  const r = require.context('./global', true, /index\.js/)
  return r.keys().map(key => r(key).default)
}

function install(Vue) {
  const directives = requireAll()
  directives.forEach(directive => {
    Vue.use(directive)
  })
}

export default {
  install
}
